package com.controller;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.dao.ClienteDao;
import com.model.ClienteModel;

@ViewScoped
@ManagedBean(name="homeAction")
public class HomeController implements Serializable {

	private ClienteModel ClienteModel;
	private ClienteDao ClienteDao = new ClienteDao();
	private List<ClienteModel> list;
	public void salvar(){
		ClienteModel = new ClienteModel();
		ClienteModel.setNome("teste");
		ClienteDao.salvar(ClienteModel);
	}
	public void listar(){
		list = ClienteDao.getClientes();
	}
	public ClienteModel getClienteModel() {
		return ClienteModel;
	}
	public void setClienteModel(ClienteModel ClienteModel) {
		this.ClienteModel = ClienteModel;
	}
	public ClienteDao getClienteDao() {
		return ClienteDao;
	}
	public void setClienteDao(ClienteDao ClienteDao) {
		this.ClienteDao = ClienteDao;
	}
	public List<ClienteModel> getList() {
		return list;
	}
	public void setList(List<ClienteModel> list) {
		this.list = list;
	}
	

}
